In here are the list of things I did for a particular hour or day. Also included here are the screenshots of games I played, or videos I watched or listened to, or just random things I stumbled upon. I'll occasionally write down what I'm thinking, or things I'm planning to do.
Uhh, I got a bit distracted and spent way more time trying to scaffold a typescript project with bun I wanted to use bun since it's really fast at compiling/bundling and it comes with all the nice stuffs that lets me skip the trouble of installing a bunch of node dependencies.
The problem is that it doesn't have a built-in feature for hot reloading client code, like what vitejs I really should have opted to go with vite, that kinds of defeat the purpose of using bun, since vite adds tons of dependencies and complexity that I don't need.
What I just need is:
After some head-scratching and fumbling, I managed to get the setup I want. Now I can go back and continue the ant project for real.
I mostly planned how the UI will behave, I decided to copy somewhat the dolphin file browser behavior. As for cell insertion, I'll add a paint mode, where I can brush or fill new cells. I might consider adding some undo/redo feature too.
The features I listed aren't exactly overscoping, they are at least necessary features for it to be useable, still doable with LOC < 1K.
I'm considering using typescript at this point though, to save me some time debugging or fixing type errors.
So I started a small project recently, against my other plans and priorities, henceforth I will designate as the "ant" project.
As the name implies, it has something to do with ants. Not literal ants though, but as a side note, I recently come across another mycmyrnae, no uh, mcmyrne, myrrnc... Myrmarachne is the word, which is a fancy name for spider-ant mimics, or spiders that pretends to be ants. It's either they are a rare bunch, or just hard to spot. In any case, ant mimics are a nice find when you see them.
The ant project will be primarily be about langton's ant Secondarily, the project will be anything related to cellular automata. The side goal is for me to have a nice UI playground for moving around blocks, for purposes of further developing my factoring algorithm.
Cellular automata are algorithmically straighforward to implement, but the question is which UI framework should I use. After some brief consideration, I just opted to use the web frontend (html+js), firstly because it's what I'm most familiar with, and second, because it's the easiest and cheapest stack to put things out there.
Initially, since I used lua for my static site, I opted to try fengari lua VM so I could still have all of my codebase in lua. This was a mistake though, since after 400 lines of crappy lua code, the web UI would stutter and lag with a grid size of 20x20. That's barely acceptable for me, because cellular automata are better with larger grids.
I thought maybe I was doing something wrong with the canvas API that was causing the lag. But I'm mostly just drawing a bunch of rectangles, surely it can't be that. So my hunch is that fengari is the problem.
I considered using p5js, but it was a large 1MB depedency, plus now I have to learn the p5js API, which would cause me to exceed the planned time budget.
The easiest fix is to try rewriting the lua code directly into javascript. After some mild frustration translating lua eccentricities to javascript, I managed to get it working and fix any weird bugs.
And the result: javascript code was way faster, even with 100x100 grids it performs smoothly. I guess the lesson of the day is that I should have tested how fengari would perform with hot loops.
Oh well, that's that.
Bah, I just spent an hour fixing bugs on my site. The strange thing is, it works fine on my machine, but when it builds on github's runner, a bunch of strange stuffs shows up.
I thought it was because I was using a macOS runner, but same thing happens on ubuntu too.
Of course, the bugs are entirely my own fault, but it would have been ideal if I could reproduce the bugs on my local computer, instead of debugging on github's action logs.
One of the reason I'm using [redbean](https://redbean.dev/) in the first place is that I'm hoping I could get that consistent behaviour across different systems without worrying about special quirks that I have to handle. Oh well, I can't have that too I guess.
Huh, for some reason I'm itching to implement some cellular automata like langton's ant, turmite, or even the classic game of life. Not exactly on the topmost priority, all things considered. But, wouldn't it be cool if I could also create a cellular automaton algorithm myself, maybe something based on factoring or prime numbers.
Well, so much for my plans for today, I mostly just did a bunch of changes on my personal site. I also managed to cut down the build time from 10 seconds to two seconds by caching the filesystem reads.
For reasons or another, I'm starting job search again. Of course, when it comes to reaching out and contacting people, I first need to make myself not too much of an eyesore. And I just realized that my profile picture is already more than a year old. How time flies.
So for tomorrow's agenda:
I'm going to put on hold on working on the factoring algorithm. I want to create a tool or app that allows me to play around with grids of rectangles that represent two numbers being multiplied. The purpose of this is to help me get a better intuition and insight, as well as develop or improve the algorithm more visually and playfully.
Playing around with paper is fine at first, but it becomes tedious for grid of size greater than 5x5.
site last updated on 2024-10-16 | created with moontpl